const { notEmpty , validatorResult } = require("./validator");

/**
 * 添加一个新动态
 */
exports.add_dynamic_validator = async (ctx, next) => {
  const errors = {};
  let result = notEmpty(ctx)(errors, "dynamic_date", "body");
      result = notEmpty(ctx)(errors, "dynamic_content", "body");
      result = notEmpty(ctx)(errors, "dynamic_user_avatar", "body");
      result = notEmpty(ctx)(errors, "dynamic_creator_id", "body");
      await validatorResult(result,ctx,next);
};

/**
 * 获取某个用户新发表动态的好友人数(不论几条 只论人数)
 */
exports.get_new_dynamic_num_validator = async (ctx,next) => {
  const errors = {};
  let result = notEmpty(ctx)(errors, "_id", "query");
      await validatorResult(result,ctx,next);
}

/**
 * 获取某用户空间所有好友动态
 */
exports.get_friends_dynamic_validator = async (ctx,next) => {
  const errors = {};
  let result = notEmpty(ctx)(errors, "_id", "query");
      await validatorResult(result,ctx,next);
}

/**
 * 根据ID获取到某一个人的所有空间动态
 */
exports.get_dynamic_validator = async (ctx,next) => {
  const errors = {};
  let result = notEmpty(ctx)(errors, "_id", "query");
      await validatorResult(result,ctx,next);
}


exports.update_dynamics_read_status_validator = async (ctx,next) => {
  const errors = {};
  let result = notEmpty(ctx)(errors, "_id", "body");
      await validatorResult(result,ctx,next);
}